package com.aaa.marketresearch.webclient.gwt.admin.widget;

import com.aaa.marketresearch.webclient.gwt.domain.BillContent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author Nail
 */
public class BillContentView extends Composite {

    interface BillContentViewUiBinder extends UiBinder<Widget, BillContentView> {
    }

    private static BillContentViewUiBinder uiBinder = GWT.create(BillContentViewUiBinder.class);

    @UiField
    Label familyMember;

    @UiField
    Label profession;

    @UiField
    Label marketName;

    @UiField
    Label goodsName;

    @UiField
    Label barcode;

    @UiField
    Label capacity;

    @UiField
    Label payedValue;


    public BillContentView(BillContent billContent) {
        // initialize
        initWidget(uiBinder.createAndBindUi(this));

        familyMember.setText(billContent.getFamilyMemberName());
        profession.setText(billContent.getProfession());
        goodsName.setText(billContent.getGoodsName());
        marketName.setText(billContent.getMarketName());
        barcode.setText(billContent.getBarcode().toString());
        capacity.setText(billContent.getCapacity().toString());

        payedValue.setText(billContent.getPayedValue().toString());
    }
}